import request from '@/utils/request'

// 查询部门列表
export function listDeptSchool(query) {
  return request({
    url: '/campus/dept/list',
    method: 'get',
    params: query
  })
}

// 查询部门列表（排除节点）
export function listDeptSchoolExcludeChild(deptId) {
  return request({
    url: '/campus/dept/list/exclude/' + deptId,
    method: 'get'
  })
}

// 查询部门详细
export function getDeptSchool(deptId) {
  return request({
    url: '/campus/dept/' + deptId,
    method: 'get'
  })
}

// 新增部门
export function addDeptSchool(data) {
  return request({
    url: '/campus/dept',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDeptSchool(data) {
  return request({
    url: '/campus/dept/put',
    method: 'post',
    data: data
  })
}

// 删除部门
export function delDeptSchool(deptId) {
  return request({
    url: '/campus/dept/' + deptId + '/delete',
    method: 'post'
  })
}

// 查询部门下拉树结构
export function deptSchoolTreeSelect() {
  return request({
    url: '/campus/dept/deptTree',
    method: 'get'
  })
}

export function schoolTree() {
  return request({
    url: '/public/stu/deptTree',
    method: 'get'
  })
}

